//
//  ViewController.m
//  UI-02-不知道
//
//  Created by dllo on 16/6/6.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor yellowColor];
    UIImageView *imageview = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
    imageview.image = [UIImage imageNamed:@"BackGround.png"];
    [self.view addSubview:imageview];
    [imageview release];
    //僵尸
    UIImageView *imageview1 = [[UIImageView alloc]initWithFrame:CGRectMake(300, 50, 100 , 200)];
    [self.view addSubview:imageview1];
    NSMutableArray *arrayZombie = [NSMutableArray array];
    for (int i = 1; i<26; i++) {
        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"BZombie%d.tiff",i]];
        [arrayZombie addObject:image];
    }
    imageview1.animationImages = arrayZombie;
    imageview1.animationDuration = 2.0;
    imageview1.animationRepeatCount = 100;
    [imageview1 startAnimating];
    [imageview1 release];
    
    UIImageView *imageview2 = [[UIImageView alloc]initWithFrame:CGRectMake(300, 280, 100, 200)];
    [self.view addSubview:imageview2];
    NSMutableArray *arrayZombie1 = [NSMutableArray array];
    for (int i = 1; i<26; i++) {
        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"BZombie%d.tiff",i]];
        [arrayZombie1 addObject:image];
    }
    imageview2.animationImages = arrayZombie1;
    imageview2.animationDuration =2.0;
    imageview2.animationRepeatCount = 100;
    [imageview2 startAnimating];
    [imageview2 release];
    
    UIImageView *imageview3 = [[UIImageView alloc]initWithFrame:CGRectMake(300, 510, 100, 200)];
    [self.view addSubview:imageview3];
    NSMutableArray *arrayZombie3 = [NSMutableArray array];
    for (int i = 1; i<26; i++) {
        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"BZombie%d.tiff",i]];
        [arrayZombie3 addObject:image];
        
    }
    imageview3.animationImages = arrayZombie3;
    imageview3.animationDuration = 2.0;
    imageview3.animationRepeatCount = 100;
    [imageview3 startAnimating];
    [imageview3 release];
    //冬瓜类
    UIImageView *imageviewGua = [[UIImageView alloc]initWithFrame:CGRectMake(50, 80, 100, 100)];
    
    [self.view addSubview:imageviewGua];
    NSMutableArray *arrayGua = [NSMutableArray array];
    for (int i = 1; i<17; i++) {
        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"gua%d.tiff",i]];
        [arrayGua addObject:image];
    }
    imageviewGua.animationImages = arrayGua;
    imageviewGua.animationRepeatCount = 100;
    imageviewGua.animationDuration = 1;
    [imageviewGua startAnimating];
    [imageviewGua release];
    //花类
    UIImageView *imageviewFlower = [[UIImageView alloc]initWithFrame:CGRectMake(50, 240, 100, 100)];
    [self.view addSubview:imageviewFlower];
    NSMutableArray *arrayFlower = [NSMutableArray array];
    for (int i = 1; i<19; i++) {
        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"flower%d.tiff",i]];
        [arrayFlower addObject:image];
    }
    imageviewFlower.animationImages  = arrayFlower;
    imageviewFlower.animationDuration = 0.9;
    imageviewFlower.animationRepeatCount = 1000;
    [imageviewFlower startAnimating];
    [imageviewFlower startAnimating];
    //植物
    UIImageView *imageviewPlants = [[UIImageView alloc]initWithFrame:CGRectMake(50, 530, 100, 100)];
    [self.view addSubview:imageviewPlants];
    NSMutableArray *arrayPlants = [NSMutableArray array];
    for (int i = 1;i<10; i++) {
        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"plants%d.tiff",i]];
        [arrayPlants addObject:image];
    }
    imageviewPlants.animationImages = arrayPlants;
    imageviewPlants.animationDuration = 0.9;
    
    imageviewPlants.animationRepeatCount = 100;
    [imageviewPlants startAnimating];
    [imageviewPlants release];
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

